﻿CREATE PROCEDURE [acms].[TopicFile_Delete]
	@Id int, 
	@ConcurencyId rowversion
AS
	If Exists (Select Null From TopicFile_View where Id = @Id) BEGIN
		Update TopicFiles
		Set Deleted = 1
		Where Id = @Id
			and ConcurencyId = @ConcurencyId
		if @@rowcount = 0
			return -100
		else
			return 0
	end
	else
		return -200
